﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CarbonExchange.Bll
{
    public class Audit : ItemBase
    {
        internal Audit()
        {
        }

        public Audit(int userId, DateTime endDate)
        {
            UserId = userId;
            EndDate = endDate;
            StartDate = endDate.AddYears(-1);
        }

        public int Id { get; internal set; }
        public string AuditKey { get; internal set; }
        public DateTime Created { get; internal set; }
        public DateTime EndDate { get; internal set; }
        public DateTime StartDate { get; internal set; }
        public int CountryId { get; set; }
        public string State { get; set; }
        public int PeopleInHousehold { get; set; }
        public int UserId { get; set; }
        public bool Completed { get; set; }

        private Country country;
        public Country Country
        {
            get
            {
                if (country == null && CountryId > 0)
                {
                    CountryFactory factory = new CountryFactory();
                    country = factory.GetById(CountryId);
                }
                return country;
            }
        }
    }
}
